﻿using System.Web.Mvc;

namespace OneWorks.Web.Common
{
    public static class CustomWebViewPage
    {
        public static void CustomRenderScript(this WebViewPage page, string baseConfig)
        {         
            var path = baseConfig + "/Page/" + page.ViewContext.RouteData.Values["Controller"] + "-" +
                       page.ViewContext.RouteData.Values["Action"] + ".js";            
            page.WriteLiteral("<script type=\"text/javascript\" src=\"" + path + "\"></script>");
        }
    }
}
